<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="ut.data.Message" %>
<%
	int newMsgCount = 0;
	if(user != null){
		newMsgCount = Message.getNewMessageCount(user.id);
	}
%>

<div id="banner">
	<div id="header">
		<img id="header-img" src="/image/banner.png" onclick="goHome();" />
	</div>
	<div id="tool">
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="document.location='/task-list-select.jsp'">
			我要接案
		</button>
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="document.location='/task-create-select.jsp'">
			我要發案
		</button>
<%
	if(user == null){
%>
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="Message.show('msg-register', 470, '註冊會員', Account.Register.instance);Account.Register.name.focus();">
			註冊
		</button>
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="Message.show('msg-login', 470, '登入會員', Account.Login.instance);Account.Login.email.focus();">
			登入
		</button>
<%
	}else{
		if(newMsgCount == 0){
%>
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="document.location='/account/user-info.jsp'">
			個人管理
		</button>
<%
		}else{
%>
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="document.location='/account/user-info.jsp'">
			個人管理
			<span class="alert"><%= newMsgCount %>
		</button>
<%
		}
%>
		<button class="button"
				onmousedown="this.style.borderStyle='inset';"
				onmouseup="this.style.borderStyle='outset';"
				onmouseout="this.style.borderStyle='outset';"
				onclick="logout();">
			登出
		</button>
<%
	}
%>
		<div style="clear:both"></div>
	</div>
</div>